package LinerSearch;

/**
 * @ClassName: Test
 * @Description: TODO
 * @Author: LiangPengFei
 * @Date: 2021/1/4 0:03
 * @Version: 1.0
 **/
public class Test {
    public static void main(String[] args) {
//        不可通过创建对象的方式调用
//        LinerSearch ls = new LinerSearch();
        Integer[] data = {2,45,6,5,8,78,2,23};
        Integer target = 8;
        System.out.println(LinerSearch.search(data,target));
        Student[] students = {new Student("Alice"),
                              new Student("Bob"),
                              new Student("Charles")};
        Student Bob = new Student("Bob");
//        比较的是两个对象的地址,需要重写Student类里的equals方法
        int res = LinerSearch.search(students,Bob);
        System.out.println(res);
    }
}
